// Author: Ivan Kazmenko (gassa@mail.ru)
module solution;
import std.algorithm;
import std.stdio;

immutable int limit = 10_001;

int solve (int a, int x, int b, int y, int n)
{
	int res = int.max;
	foreach (step; 0..limit)
	{
		if (n == b)
		{
			res = min (res, step);
		}
		else if (n > b && b > y && n % (b - y) == b % (b - y))
		{
			res = min (res, step + (n - b) / (b - y));
		}

		if (n < a)
		{
			break;
		}
		n -= a;
		if (n == 0)
		{
			res = min (res, step);
			break;
		}
		n += x;
	}

	return res;
}

void main ()
{
	int a, x;
	int b, y;
	int n;
	while (readf (" %s %s", &a, &x) > 0)
	{
		readf (" %s %s", &b, &y);
		readf (" %s", &n);
		int res = int.max;
		res = min (res, solve (a, x, b, y, n));
		if (res == int.max)
		{
			res = -1;
		}
		writeln (res);
	}
}
